﻿using MediatR;
using S.EarTag.Domain.Model;
using S.EarTag.Infrastructure.Repository.Interface.IEarTagRepository;
using S.EarTag.Read.API.Application.MediatorCommand.MarkCommand;

namespace S.EarTag.Read.API.Application.MediatorCommandHandler.MarkCommandHandler
{
    public class MarkGetAllCommandHandler : IRequestHandler<MarkGetAllCommand, List<MarkModel>>
    {
        private readonly IMarkModelRepository _markModelRepository;
        public MarkGetAllCommandHandler(IMarkModelRepository markModelRepository)
        {
            _markModelRepository = markModelRepository;
        }
        /// <summary>
        /// 查询状态为未使用的耳号
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<List<MarkModel>> Handle(MarkGetAllCommand request, CancellationToken cancellationToken)
        {
            return await _markModelRepository.GetMarkModels();
        }
    }
}
